%% $Id: Pixmap.tex,v 1.5 1992/10/16 17:05:13 mallet Exp $
\documentstyle{article} 
\newcommand{\PAGESIZE}[2]
        {
                \textheight #1
                \textwidth #2
        }
 \newcommand{\MARGINS}[3]
        {
                \topmargin #1
                \oddsidemargin #2
                \evensidemargin #3
        }
\PAGESIZE{21.5cm}{16cm}
\MARGINS{-10mm}{0mm}{0mm}
\footskip 20mm

\title{Pixmap Editor Reference Card}
\author{Copyright L. Mallet - Simulog}
\date{October 1992}
\begin{document} 
\maketitle
\section{Command line options}

The pixmap editor can parse the following command line options:\\

\begin{tabular}{|l|p{8cm}|}
\hline
{\tt -display/-d Display}   & specify the display on which start the
Pixmap editor\\\hline
{\tt -geometry Geometry} & specify the geometry of the Pixmap editor
window, {\tt Geometry} is a standard X Window geometry
specification\\\hline
{\tt -help/-h}           & ask for usage description\\\hline
{\tt -size WidthxHeight} & specify the width and height of the pixmap
to be edited\\\hline
{\tt -squares Dimension} & specify the dimension of the squares
representing pixels on the screen ({\tt -squares 5} will display 
each pixel of the pixmap in a square of width and height of 5 screen
points)\\\hline
{\tt +grid/-grid}        & specify if the grid should be displayed or not by
default when starting the editor\\\hline
{\tt -stippled}		 & turn off stippled drawing of transparent pixels\\\hline
{\tt -stipple Pixmap} 	 & specify the stipple depth 1 pixmap to use to draw
transparent pixels\\\hline
{\tt +axes/-axes}        & specify if the axes should be displayed or not by
default when starting the editor\\\hline
{\tt -proportional/+proportional} & specify if all available space
should be used or not in editor to display the pixmap or if squares
should remain proportional, i.e. if a 4x3 pixmap will fit the space in
the editor or not)\\\hline 
{\tt -hl color}          & specify the color to use when highlighting\\\hline
{\tt -fr color}          & specify the color to use for the Pixmap
widget frame, i.e., the grid, axes and frame lines surrounding the
pixmap\\\hline
{\tt -tr color} & specify the color to use to represent
transparent pixels\\\hline
{\tt -fn/-font fontname}     & specify the font to use within the Pixmap
editor\\\hline
{\tt -filename/-f/-in filename} & specify the name of the file from
which the pixmap to be edited should be loaded\\\hline
\end{tabular}\\

\noindent
Colors should be specified by name. A color name can be anyone
accepted by the function XParseColor.\\

\noindent
The default command line options are:
\begin{verbatim} 
    -size 32x32 -squares 20 +grid -axes +proportional -hl black -fr black 
    -tr gray90 -filename scratch
\end{verbatim} 
However, some of these options can be overidden in the application
defaults file ({\tt \$XAPPLRESDIR/Pixmap}), e.g., squares
which is set to 15, or in the user's resource configuration file
({\tt \$HOME/.Xdefaults}). 

\section{Pixmap widget resources}
The Pixmap widget can be modified through its resources. They are :\\

\begin{tabular}{|l|l|p{5cm}|l|}
\hline
Name	& Type	& Definition	& Default\\\hline\hline
XtNcursor & Cursor & cursor used within Pixmap widget & XC\_tcross\\\hline
XtNforeground & Pixel & initial foreground color of the pixmap & XtDefaultForeground\\\hline
XtNhighlight & Pixel & highlighting color & XtDefaultForeground\\\hline
XtNframing & Pixel & framing color (to draw grid and axes) &
XtDefaultForeground\\\hline
XtNtransparent & Pixel & transparent pixels color &
XtNDefaultTransparent\\\hline
XtNproportional & Boolean & toggle proportional display & True\\\hline
XtNgrid & Boolean & toggle grid display & True\\\hline
XtNgridTolerance & Dimension & tolerance of grid display, if squareWidth
or squareHeight are lower or equal to gridTolerance, even if
requested by resource grid, grid is not displayed & 5\\\hline
XtNstippled & Boolean & toggle stipple display of transparent pixels &
True\\\hline
XtNstipple & Pixmap & stipple depth 1 pixmap to use to display transparent
pixels & XtUnspecifiedPixmap\\\hline
XtNaxes & Boolean & toggle axes display & False\\\hline
XtNresize & Boolean & toggle resize Pixmap widget & True\\\hline
XtNdistance & Dimension & space between border and pixmap & 10\\\hline
XtNsquareSize & Dimension & widht and height of squares & 20\\\hline
XtNpixmapWidth & Dimension & initial width of the pixmap & 32\\\hline
XtNpixmapHeight & Dimension & initial height of the pixmap & 32\\\hline
XtNbutton1Action & Int & action of button 1 & Set\\\hline
XtNbutton2Action & Int & action of button 2 & Invert\\\hline
XtNbutton3Action & Int & action of button 3 & Clear\\\hline
XtNbutton4Action & Int & action of button 4 & Clear\\\hline
XtNbutton5Action & Int & action of button 5 & Clear\\\hline
XtNfilename & String & name of default file to read & scratch\\\hline
XtNaddColorNtfyProc & AddColorNotifyProc & procedure to call while reading
pixmap file to notify color loading & NULL\\\hline
XtNextensionNtfyProc & ExtensionNotifyProc & procedure to call while reading
pixmap file to notify extension loading & NULL\\\hline
\end{tabular}\\ 

\noindent
{\tt XtNDefaultTransparent} color is {\tt gray90}.

\section{Default Button Settings}

\begin{itemize} 
\item button 1: Set
\item button 2: Invert
\item button 3: Clear
\item button 4: Clear
\item button 5: Clear
\end{itemize} 

\section{Default Key Bindings}
Most of the commands are directly available from the keyboard by means
of accelerators. Here is the set of accelerators defined:\\

\begin{tabular}{|p{4cm}|p{10cm}|}
\hline
Key			& Action\\\hline\hline
Alt$<$Key$>$l		& load pixmap from file\\\hline
Alt$<$Key$>$i		& insert pixmap from file in Cut\&Paste
buffer\\\hline
Alt$<$Key$>$s		& save pixmap to current file\\\hline
Alt$<$Key$>$a		& save pixmap to file\\\hline
Alt$<$Key$>$r		& resize pixmap\\\hline
Alt$<$Key$>$e		& rescale pixmap\\\hline
Alt$<$Key$>$f		& set current filename\\\hline
Alt$<$Key$>$h		& set hints comment\\\hline
Alt$<$Key$>$c		& set colors comment\\\hline
Alt$<$Key$>$p		& set pixels comment\\\hline
Alt$<$Key$>$q		& quit\\\hline
$<$Key$>$i		& toggle image\\\hline
$<$Key$>$g		& toggle grid\\\hline
$<$Key$>$a		& toggle axes\\\hline
$<$Key$>$p		& toggle proportional\\\hline
$<$Key$>$z		& toggle zoom\\\hline
$<$Key$>$x		& zoom into pixmap\\\hline
$<$Key$>$y		& zoom out of pixmap\\\hline
$<$Key$>$f		& set zoom factor\\\hline
Ctrl$<$Key$>$c		& cut to Cut\&Paste buffer\\\hline
Ctrl$<$Key$>$x		& copy to Cut\&Paste buffer\\\hline
Ctrl$<$Key$>$p		& paste Cut\&Paste buffer\\\hline
Ctrl$<$Key$>$o		& rotate marked area or Cut\&Paste buffer and image\\\hline
Ctrl$<$Key$>$a		& add color in color menu\\\hline
Ctrl$<$Key$>$s		& symbolic name of current color\\\hline
Ctrl$<$Key$>$m		& monochrome name of current color\\\hline
Ctrl$<$Key$>$4		& grey scale 4 name of current color\\\hline
Ctrl$<$Key$>$g		& grey scale name of current color\\\hline
Ctrl$<$Key$>$n		& color name of current color\\\hline
Ctrl$<$Btn1Down$>$	& mark region\\\hline
Ctrl$<$Btn2Down$>$	& paste Cut\&Paste buffer to point\\\hline
Ctrl$<$Btn3Down$>$	& unmark region\\\hline
Shift$<$BtnUp$>$	& set drawing color to pixel color\\\hline
Ctrl$<$Key$>$l		& redraw pixmap\\\hline
Any$<$Key$>$d		& toggle debug mode\\\hline
Any$<$Key$>$t		& terminate current engaged request (current action)\\\hline
Any$<$Key$>$Up		& move pixmap image up (not in Motif version)\\\hline
Any$<$Key$>$Down	& move pixmap image down (not in Motif version)\\\hline
Any$<$Key$>$Left	& move pixmap image left (not in Motif version)\\\hline
Any$<$Key$>$Right	& move pixmap image right (not in Motif version)\\\hline
$[$Shift$|$Ctrl$]<$Key$>$f& fold pixmap image, inverse top and bottom, and left
and right\\\hline
$[$Shift$|$Ctrl$]<$Key$>$h	& flip pixmap image horizontally\\\hline
Any$<$Key$>$v		& flip pixmap image vertically\\\hline
$[$Shift$|$Ctrl$]<$Key$>$r& rotate pixmap image right (clockwise)\\\hline
$[$Shift$]<$Key$>$l	& rotate pixmap image left (counterclock)\\\hline
$[$Shift$]<$Key$>$s	& set pixmap to current color (all pixels are set)\\\hline
$[$Shift$]<$Key$>$c	& clear pixmap image (all pixels are cleared)\\\hline
Any$<$Key$>$u		& undo last operation\\\hline
\end{tabular}\\

In the Motif version, some actions, namely
Any$<$Key$>[$Left$|$Right$|$Up$|$Down$]$, are overriden by XmManager
widget translation table and thus are not available.\\

\section{Configuration files}

The Pixmap editor is configurable by means of standard X Window files.
They are read in the following order : 
\begin{itemize} 
\item application defaults file ({\tt /usr/lib/X11/app-defaults/Pixmap}), 
\item user resource database file ({\tt \$HOME/.Xdefaults}).
\end{itemize} 

But the color interface is also configurable by means of a color
database file which can be located in the application defaults
directory, in the user's home directory or in the directory from which
the Pixmap editor was started. The color database file is named ``{\tt
.pixmap}''. The precedence order is : 
\begin{enumerate} 
\item local directory file, 
\item user's home directory file,
\item application defaults directory file.
\end{enumerate} 

This file is a list of color names (accepted by XParseColor, i.e.,
either a name found in the rgb database file or a name like ``\#rgb''
where r, g and b are hexadecimal values specifying the red, green and
blue components of the color), one on
each line.

\begin{verbatim} 
                                   blue
                                   red
                                   #000040408F8F
                                   white
                                   #000000000000
\end{verbatim} 
\centerline{Example of a color database file.}

\end{document} 
